import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "./utils";

/** 获取配置列表 */
export const getCommon = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/common/list"), { params });
};

/** 获取基础档案-数据字典列表 */
export const getDictionary = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/dictionary/page"), {
    params: filerEmptyVal(params)
  });
};

/** 门店列表 */
export const getStorePage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/store/simple/page"), {
    params: filerEmptyVal(params)
  });
};

/** 仓库列表 */
export const getDepositoryPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/depository/simple/page"), {
    params: filerEmptyVal(params)
  });
};

/** 门店用户列表 */
export const getUserPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/user/page"), {
    params: filerEmptyVal(params)
  });
};

/** 获取基础档案-商品类目管理列表 */
export const getProductPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/category/page"), { params });
};

/** 获取基础档案-供应商管理列表 */
export const getSupplierSimplePage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/supplier/simple/page"), {
    params: filerEmptyVal(params)
  });
};
